package cn.hls.entity;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * @fileName: Member.java
 * @package: cn.christ.entity
 * @Description: 人员基本信息
 * @author: yinghui.zhang
 * @email: uuhui@163.comR
 * @date: 2015-7-18
 */
@Entity
@Table(name = "t_member")
@DynamicInsert
@DynamicUpdate
public class Member extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String name;// 姓名
	private String gender;// 性别 1-男 2-女
	private Date birthDay;// 出生日期
	private Integer type;// 类型 1-驾驶员 2-押运员 3-安管员 4-装卸管理员 5-主要负责人
	private String idno;// 身份证号
	private String photo;// 个人照片
	private String contractPhone;// 联系电话
	private String homePhone;// 家庭电话
	private String dutyPost;// 岗位
	private String driverLiceseNum;// 驾驶证号
	private Date driverLiceseNumValidity;// 驾驶证有效期
	private String driverType;// 准驾类型
	private Integer status;// 状态 0-离职 1-在职
	private String superCargoNum;// 押运从业证号
	private Date superCargoNumValidity;// 押运从业证号有效期
	private String safetyOfficerNum;// 安管资格员证
	private Date safetyOfficerNumValidity;// 安管资格员证有效期
	private String mainPersonResNum;// 主要负责人资格证号
	private Date mainPersonResNumValidity;// 主要负责人资格证号有效期
	private String driverQuaCertNum;// 驾驶员资格证号
	private Date driverQuaCertNumValidity;// 驾驶员资格证号有效期

	private String loadUnloadManNum;// 装卸管理员证号
	private Date loadUnloadManNumValidity;// 装卸管理员证号有效期
	private String address;// 联系地址
	private Company company;// 所在企业
	private Integer employTime;// 企业聘用期限
	private Integer dutyTime;// 责任状期限
	private String remark;// 备注
	private Date beginTime;// 开始时间
	private Date endTime;// 结束时间
	private String statisticsColum;// 过期汇总统计字段

	@Column(name = "name", length = 16)
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "gender", length = 1, columnDefinition = "char default 1")
	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(name = "birth_day")
	public Date getBirthDay() {
		return birthDay;
	}

	public void setBirthDay(Date birthDay) {
		this.birthDay = birthDay;
	}

	@Column(name = "type", length = 1, columnDefinition = "char default 1")
	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "id_no", length = 18)
	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	@Column(name = "contract_phone", length = 16)
	public String getContractPhone() {
		return contractPhone;
	}

	public void setContractPhone(String contractPhone) {
		this.contractPhone = contractPhone;
	}

	@Column(name = "home_phone", length = 16)
	public String getHomePhone() {
		return homePhone;
	}

	public void setHomePhone(String homePhone) {
		this.homePhone = homePhone;
	}

	@Column(name = "duty_post", length = 16)
	public String getDutyPost() {
		return dutyPost;
	}

	public void setDutyPost(String dutyPost) {
		this.dutyPost = dutyPost;
	}

	@Column(name = "driver_licese_num")
	public String getDriverLiceseNum() {
		return driverLiceseNum;
	}

	public void setDriverLiceseNum(String driverLiceseNum) {
		this.driverLiceseNum = driverLiceseNum;
	}

	@Column(name = "super_cargo_num")
	public String getSuperCargoNum() {
		return superCargoNum;
	}

	public void setSuperCargoNum(String superCargoNum) {
		this.superCargoNum = superCargoNum;
	}

	@Column(name = "status", length = 1, columnDefinition = "char default 1")
	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "address")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@ManyToOne(cascade = CascadeType.REFRESH)
	@NotFound(action = NotFoundAction.IGNORE)
	@JoinColumn(name = "company_id")
	public Company getCompany() {
		return company;
	}

	public void setCompany(Company company) {
		this.company = company;
	}

	@Column(name = "remark")
	@JsonIgnore
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Transient
	@JsonIgnore
	public Date getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(Date beginTime) {
		this.beginTime = beginTime;
	}

	@Transient
	@JsonIgnore
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	@Column(name = "photo", length = 128)
	public String getPhoto() {
		return photo;
	}

	public void setPhoto(String photo) {
		this.photo = photo;
	}

	@Column(name = "driver_licese_num_validity")
	public Date getDriverLiceseNumValidity() {
		return driverLiceseNumValidity;
	}

	public void setDriverLiceseNumValidity(Date driverLiceseNumValidity) {
		this.driverLiceseNumValidity = driverLiceseNumValidity;
	}

	@Column(name = "driver_type", length = 32)
	public String getDriverType() {
		return driverType;
	}

	public void setDriverType(String driverType) {
		this.driverType = driverType;
	}

	@Column(name = "super_cargo_num_validity")
	public Date getSuperCargoNumValidity() {
		return superCargoNumValidity;
	}

	public void setSuperCargoNumValidity(Date superCargoNumValidity) {
		this.superCargoNumValidity = superCargoNumValidity;
	}

	@Column(name = "safety_officer_num", length = 32)
	public String getSafetyOfficerNum() {
		return safetyOfficerNum;
	}

	public void setSafetyOfficerNum(String safetyOfficerNum) {
		this.safetyOfficerNum = safetyOfficerNum;
	}

	@Column(name = "safety_officer_num_validity")
	public Date getSafetyOfficerNumValidity() {
		return safetyOfficerNumValidity;
	}

	public void setSafetyOfficerNumValidity(Date safetyOfficerNumValidity) {
		this.safetyOfficerNumValidity = safetyOfficerNumValidity;
	}

	@Column(name = "main_Person_Res_Num", length = 32)
	public String getMainPersonResNum() {
		return mainPersonResNum;
	}

	public void setMainPersonResNum(String mainPersonResNum) {
		this.mainPersonResNum = mainPersonResNum;
	}

	@Column(name = "MAIN_PERSON_RES_NUM_VALIDITY")
	public Date getMainPersonResNumValidity() {
		return mainPersonResNumValidity;
	}

	public void setMainPersonResNumValidity(Date mainPersonResNumValidity) {
		this.mainPersonResNumValidity = mainPersonResNumValidity;
	}

	@Column(name = "driver_quacert_num", length = 32)
	public String getDriverQuaCertNum() {
		return driverQuaCertNum;
	}

	public void setDriverQuaCertNum(String driverQuaCertNum) {
		this.driverQuaCertNum = driverQuaCertNum;
	}

	@Column(name = "driver_quacert_num_validity")
	public Date getDriverQuaCertNumValidity() {
		return driverQuaCertNumValidity;
	}

	public void setDriverQuaCertNumValidity(Date driverQuaCertNumValidity) {
		this.driverQuaCertNumValidity = driverQuaCertNumValidity;
	}

	@Column(name = "LOAD_UNLOAD_MAN_NUM", length = 32)
	public String getLoadUnloadManNum() {
		return loadUnloadManNum;
	}

	public void setLoadUnloadManNum(String loadUnloadManNum) {
		this.loadUnloadManNum = loadUnloadManNum;
	}

	@Column(name = "LOAD_UNLOAD_MAN_NUM_validity")
	public Date getLoadUnloadManNumValidity() {
		return loadUnloadManNumValidity;
	}

	public void setLoadUnloadManNumValidity(Date loadUnloadManNumValidity) {
		this.loadUnloadManNumValidity = loadUnloadManNumValidity;
	}

	@Column(name = "employee_time")
	public Integer getEmployTime() {
		return employTime;
	}

	public void setEmployTime(Integer employTime) {
		this.employTime = employTime;
	}

	@Column(name = "duty_time")
	public Integer getDutyTime() {
		return dutyTime;
	}

	public void setDutyTime(Integer dutyTime) {
		this.dutyTime = dutyTime;
	}

	@JsonIgnore
	@Transient
	public String getStatisticsColum() {
		return statisticsColum;
	}

	public void setStatisticsColum(String statisticsColum) {
		this.statisticsColum = statisticsColum;
	}

}
